package net.xiduth.game.player.dialogues;

import java.io.File;
import java.util.HashMap;

import net.xiduth.game.player.content.citadels.Enter;
import net.xiduth.game.player.content.citadels.LeavingCitadel;
import net.xiduth.game.player.dialogues.armour.morrigan.DegMorriganCoif;
import net.xiduth.game.player.dialogues.armour.morrigan.DegMorriganLeatherBody;
import net.xiduth.game.player.dialogues.armour.morrigan.DegMorriganLeatherChaps;
import net.xiduth.game.player.dialogues.armour.pernix.BrokenPernixBody;
import net.xiduth.game.player.dialogues.armour.pernix.BrokenPernixChaps;
import net.xiduth.game.player.dialogues.armour.pernix.BrokenPernixCowl;
import net.xiduth.game.player.dialogues.armour.statius.DegStatiusFullHelm;
import net.xiduth.game.player.dialogues.armour.statius.DegStatiusPlatebody;
import net.xiduth.game.player.dialogues.armour.statius.DegStatiusPlatelegs;
import net.xiduth.game.player.dialogues.armour.statius.DegStatiusWarHammer;
import net.xiduth.game.player.dialogues.armour.torva.BrokenTorvaHelm;
import net.xiduth.game.player.dialogues.armour.torva.BrokenTorvaPlatebody;
import net.xiduth.game.player.dialogues.armour.torva.BrokenTorvaPlatelegs;
import net.xiduth.game.player.dialogues.armour.vesta.DegVestaChainbody;
import net.xiduth.game.player.dialogues.armour.vesta.DegVestaLongsword;
import net.xiduth.game.player.dialogues.armour.vesta.DegVestaPlateskirt;
import net.xiduth.game.player.dialogues.armour.vesta.DegVestaSpear;
import net.xiduth.game.player.dialogues.armour.virtus.BrokenVirtusMask;
import net.xiduth.game.player.dialogues.armour.virtus.BrokenVirtusRobeLegs;
import net.xiduth.game.player.dialogues.armour.virtus.BrokenVirtusRobeTop;
import net.xiduth.game.player.dialogues.armour.zuriel.DegZurielHood;
import net.xiduth.game.player.dialogues.armour.zuriel.DegZurielRobeBottom;
import net.xiduth.game.player.dialogues.armour.zuriel.DegZurielRobeTop;
import net.xiduth.game.player.dialogues.armour.zuriel.DegZurielStaff;
import net.xiduth.game.player.dialogues.auto.Page2PvM;
import net.xiduth.game.player.dialogues.auto.Page3PvM;
import net.xiduth.game.player.dialogues.auto.PvMRewards;
import net.xiduth.game.player.dialogues.auto.TrainingTeleports;
import net.xiduth.game.player.dialogues.dominion.DTClaimRewards;
import net.xiduth.game.player.dialogues.dominion.DTRewards;
import net.xiduth.game.player.dialogues.dominion.DTSpectateReq;
import net.xiduth.game.player.dialogues.tutorial.CooksAssistant;
import net.xiduth.game.player.dialogues.tutorial.Fred;
import net.xiduth.game.player.dialogues.tutorial.Groats;
import net.xiduth.game.player.dialogues.tutorial.Nasaroth;
import net.xiduth.game.player.dialogues.tutorial.SkillsInstructor;
import net.xiduth.utils.Logger;

public final class DialogueHandler {

	private static final HashMap<Object, Class<Dialogue>> handledDialogues = new HashMap<Object, Class<Dialogue>>();

	@SuppressWarnings("unchecked")
	public static final void init() {
		try {
			Class<Dialogue> value1 = (Class<Dialogue>) Class
					.forName(LevelUp.class.getCanonicalName());
			handledDialogues.put("LevelUp", value1);
			Class<Dialogue> value2 = (Class<Dialogue>) Class
					.forName(ZarosAltar.class.getCanonicalName());
			handledDialogues.put("ZarosAltar", value2);
			Class<Dialogue> value3 = (Class<Dialogue>) Class
					.forName(ClimbNoEmoteStairs.class.getCanonicalName());
			handledDialogues.put("ClimbNoEmoteStairs", value3);
			Class<Dialogue> value4 = (Class<Dialogue>) Class
					.forName(Banker.class.getCanonicalName());
			handledDialogues.put("Banker", value4);
			Class<Dialogue> value5 = (Class<Dialogue>) Class
					.forName(DestroyItemOption.class.getCanonicalName());
			handledDialogues.put("DestroyItemOption", value5);
			Class<Dialogue> value6 = (Class<Dialogue>) Class
					.forName(FremennikShipmaster.class.getCanonicalName());
			handledDialogues.put("FremennikShipmaster", value6);
			Class<Dialogue> value8 = (Class<Dialogue>) Class
					.forName(NexEntrance.class.getCanonicalName());
			handledDialogues.put("NexEntrance", value8);
			Class<Dialogue> value9 = (Class<Dialogue>) Class
					.forName(MagicPortal.class.getCanonicalName());
			handledDialogues.put("MagicPortal", value9);
			Class<Dialogue> value10 = (Class<Dialogue>) Class
					.forName(LunarAltar.class.getCanonicalName());
			handledDialogues.put("LunarAltar", value10);
			Class<Dialogue> value11 = (Class<Dialogue>) Class
					.forName(AncientAltar.class.getCanonicalName());
			handledDialogues.put("AncientAltar", value11);
			Class<Dialogue> value12 = (Class<Dialogue>) Class
					.forName(FletchingD.class.getCanonicalName());
			handledDialogues.put("FletchingD", value12);
			Class<Dialogue> value14 = (Class<Dialogue>) Class
					.forName(RuneScapeGuide.class.getCanonicalName());
			handledDialogues.put("RuneScapeGuide", value14);
			Class<Dialogue> value15 = (Class<Dialogue>) Class
					.forName(SurvivalExpert.class.getCanonicalName());
			handledDialogues.put("SurvivalExpert", value15);
			Class<Dialogue> value16 = (Class<Dialogue>) Class
					.forName(SimpleMessage.class.getCanonicalName());
			handledDialogues.put("SimpleMessage", value16);
			Class<Dialogue> value17 = (Class<Dialogue>) Class
					.forName(ItemMessage.class.getCanonicalName());
			handledDialogues.put("ItemMessage", value17);
			Class<Dialogue> value18 = (Class<Dialogue>) Class
					.forName(ClimbEmoteStairs.class.getCanonicalName());
			handledDialogues.put("ClimbEmoteStairs", value18);
			Class<Dialogue> value19 = (Class<Dialogue>) Class
					.forName(QuestGuide.class.getCanonicalName());
			handledDialogues.put("QuestGuide", value19);
			Class<Dialogue> value20 = (Class<Dialogue>) Class
					.forName(GemCuttingD.class.getCanonicalName());
			handledDialogues.put("GemCuttingD", value20);
			Class<Dialogue> value21 = (Class<Dialogue>) Class
					.forName(CookingD.class.getCanonicalName());
			handledDialogues.put("CookingD", value21);
			Class<Dialogue> value22 = (Class<Dialogue>) Class
					.forName(HerbloreD.class.getCanonicalName());
			handledDialogues.put("HerbloreD", value22);
			Class<Dialogue> value23 = (Class<Dialogue>) Class
					.forName(BarrowsD.class.getCanonicalName());
			handledDialogues.put("BarrowsD", value23);
			Class<Dialogue> value24 = (Class<Dialogue>) Class
					.forName(SmeltingD.class.getCanonicalName());
			handledDialogues.put("SmeltingD", value24);
			Class<Dialogue> value25 = (Class<Dialogue>) Class
					.forName(LeatherCraftingD.class.getCanonicalName());
			handledDialogues.put("LeatherCraftingD", value25);
			Class<Dialogue> value26 = (Class<Dialogue>) Class
					.forName(EnchantedGemDialouge.class.getCanonicalName());
			handledDialogues.put("EnchantedGemDialouge", value26);
			Class<Dialogue> value27 = (Class<Dialogue>) Class
					.forName(ForfeitDialouge.class.getCanonicalName());
			handledDialogues.put("ForfeitDialouge", value27);
			Class<Dialogue> value28 = (Class<Dialogue>) Class
					.forName(Transportation.class.getCanonicalName());
			handledDialogues.put("Transportation", value28);
			Class<Dialogue> value29 = (Class<Dialogue>) Class
					.forName(WildernessDitch.class.getCanonicalName());
			handledDialogues.put("WildernessDitch", value29);
			Class<Dialogue> value30 = (Class<Dialogue>) Class
					.forName(SimpleNPCMessage.class.getCanonicalName());
			handledDialogues.put("SimpleNPCMessage", value30);
			Class<Dialogue> value31 = (Class<Dialogue>) Class
					.forName(Transportation.class.getCanonicalName());
			handledDialogues.put("Transportation", value31);
			Class<Dialogue> value32 = (Class<Dialogue>) Class
					.forName(DTSpectateReq.class.getCanonicalName());
			handledDialogues.put("DTSpectateReq", value32);
			Class<Dialogue> value33 = (Class<Dialogue>) Class
					.forName(StrangeFace.class.getCanonicalName());
			handledDialogues.put("StrangeFace", value33);
			Class<Dialogue> value34 = (Class<Dialogue>) Class
					.forName(AncientEffigiesD.class.getCanonicalName());
			handledDialogues.put("AncientEffigiesD", value34);
			Class<Dialogue> value35 = (Class<Dialogue>) Class
					.forName(DTClaimRewards.class.getCanonicalName());
			handledDialogues.put("DTClaimRewards", value35);
			Class<Dialogue> value36 = (Class<Dialogue>) Class
					.forName(SetSkills.class.getCanonicalName());
			handledDialogues.put("SetSkills", value36);
			Class<Dialogue> value37 = (Class<Dialogue>) Class
					.forName(DismissD.class.getCanonicalName());
			handledDialogues.put("DismissD", value37);
			Class<Dialogue> value38 = (Class<Dialogue>) Class
					.forName(MrEx.class.getCanonicalName());
			handledDialogues.put("MrEx", value38);
			Class<Dialogue> value45 = (Class<Dialogue>) Class
					.forName(RuneSpanStore.class.getCanonicalName());
			handledDialogues.put("RuneSpanStore", value45);
			Class<Dialogue> value39 = (Class<Dialogue>) Class
					.forName(MakeOverMage.class.getCanonicalName());
			handledDialogues.put("MakeOverMage", value39);
			Class<Dialogue> value40 = (Class<Dialogue>) Class
					.forName(KaramjaTrip.class.getCanonicalName());
			handledDialogues.put("KaramjaTrip", value40);
			Class<Dialogue> value42 = (Class<Dialogue>) Class
					.forName(DagonHai.class.getCanonicalName());
			handledDialogues.put("DagonHai", value42);
			Class<Dialogue> value43 = (Class<Dialogue>) Class
					.forName(TeleportCrystal.class.getCanonicalName());
			handledDialogues.put("TeleportCrystal", value43);
			handledDialogues.put("clan_wars_view", (Class<Dialogue>) Class
					.forName(ClanWarsViewing.class.getCanonicalName()));
			handledDialogues.put("SummoningShop", (Class<Dialogue>) Class
					.forName(SummoningShop.class.getCanonicalName()));
			handledDialogues.put("Kuradal", (Class<Dialogue>) Class
					.forName(Kuradal.class.getCanonicalName()));
			handledDialogues.put("Spria", (Class<Dialogue>) Class
					.forName(Spria.class.getCanonicalName()));
			handledDialogues.put("Mazchna", (Class<Dialogue>) Class
					.forName(Mazchna.class.getCanonicalName()));
			handledDialogues.put("DiceBag", (Class<Dialogue>) Class
					.forName(DiceBag.class.getCanonicalName()));
			handledDialogues.put("PartyPete", (Class<Dialogue>) Class
					.forName(PartyPete.class.getCanonicalName()));
			handledDialogues.put("PartyRoomLever", (Class<Dialogue>) Class
					.forName(PartyRoomLever.class.getCanonicalName()));
			handledDialogues.put("DrogoDwarf", (Class<Dialogue>) Class
					.forName(DrogoDwarf.class.getCanonicalName()));
			handledDialogues.put("GeneralStore", (Class<Dialogue>) Class
					.forName(GeneralStore.class.getCanonicalName()));
			handledDialogues.put("Nurmof", (Class<Dialogue>) Class
					.forName(Nurmof.class.getCanonicalName()));
			handledDialogues.put("BootDwarf", (Class<Dialogue>) Class
					.forName(BootDwarf.class.getCanonicalName()));
			handledDialogues.put("MiningGuildDwarf", (Class<Dialogue>) Class
					.forName(MiningGuildDwarf.class.getCanonicalName()));
			handledDialogues.put("Man", (Class<Dialogue>) Class
					.forName(Man.class.getCanonicalName()));
			handledDialogues.put("Guildmaster", (Class<Dialogue>) Class
					.forName(Guildmaster.class.getCanonicalName()));
			handledDialogues.put("Scavvo", (Class<Dialogue>) Class
					.forName(Scavvo.class.getCanonicalName()));
			handledDialogues.put("Valaine", (Class<Dialogue>) Class
					.forName(Valaine.class.getCanonicalName()));
			handledDialogues.put("Hura", (Class<Dialogue>) Class
					.forName(Hura.class.getCanonicalName()));
			handledDialogues.put("TzHaarMejJal", (Class<Dialogue>) Class
					.forName(TzHaarMejJal.class.getCanonicalName()));
			handledDialogues.put("TzHaarMejKah", (Class<Dialogue>) Class
					.forName(TzHaarMejKah.class.getCanonicalName()));
			handledDialogues.put("MasterOfFear", (Class<Dialogue>) Class
					.forName(MasterOfFear.class.getCanonicalName()));
			handledDialogues.put("TokHaarHok", (Class<Dialogue>) Class
					.forName(TokHaarHok.class.getCanonicalName()));
			handledDialogues.put("NomadThrone", (Class<Dialogue>) Class
					.forName(NomadThrone.class.getCanonicalName()));
			handledDialogues.put("SimplePlayerMessage", (Class<Dialogue>) Class
					.forName(SimplePlayerMessage.class.getCanonicalName()));
			handledDialogues.put("BonfireD", (Class<Dialogue>) Class
					.forName(BonfireD.class.getCanonicalName()));
			handledDialogues.put("MasterChef", (Class<Dialogue>) Class
					.forName(MasterChef.class.getCanonicalName()));
			handledDialogues.put("FightKilnDialogue", (Class<Dialogue>) Class
					.forName(FightKilnDialogue.class.getCanonicalName()));
			handledDialogues.put("RewardChest", (Class<Dialogue>) Class
					.forName(RewardChest.class.getCanonicalName()));
			handledDialogues.put("WizardFinix", (Class<Dialogue>) Class
					.forName(WizardFinix.class.getCanonicalName()));
			handledDialogues.put("RunespanPortalD", (Class<Dialogue>) Class
					.forName(RunespanPortalD.class.getCanonicalName()));
			handledDialogues.put("RuneSpanLeaving", (Class<Dialogue>) Class
					.forName(RuneSpanLeaving.class.getCanonicalName()));
			handledDialogues.put("SorceressGardenNPCs", (Class<Dialogue>) Class
					.forName(SorceressGardenNPCs.class.getCanonicalName()));
			handledDialogues.put("Marv", (Class<Dialogue>) Class
					.forName(Marv.class.getCanonicalName()));
			handledDialogues.put("FlamingSkull", (Class<Dialogue>) Class
					.forName(FlamingSkull.class.getCanonicalName()));
			handledDialogues.put("Hairdresser", (Class<Dialogue>) Class
					.forName(Hairdresser.class.getCanonicalName()));
			handledDialogues.put("Thessalia", (Class<Dialogue>) Class
					.forName(Thessalia.class.getCanonicalName()));
			handledDialogues.put("GrilleGoatsD", (Class<Dialogue>) Class
					.forName(GrilleGoatsDialogue.class.getCanonicalName()));
			handledDialogues.put("Ajjat", (Class<Dialogue>) Class
					.forName(Ajjat.class.getCanonicalName()));
			handledDialogues.put("Sloane", (Class<Dialogue>) Class
					.forName(Sloane.class.getCanonicalName()));
			handledDialogues.put("MeleeInstructor", (Class<Dialogue>) Class
					.forName(MeleeInstructor.class.getCanonicalName()));
			handledDialogues.put("ArmourSalesman", (Class<Dialogue>) Class
					.forName(ArmourSalesman.class.getCanonicalName()));
			handledDialogues.put("BrotherJered", (Class<Dialogue>) Class
					.forName(BrotherJered.class.getCanonicalName()));
			handledDialogues.put("RobeStoreOwner", (Class<Dialogue>) Class
					.forName(RobeStoreOwner.class.getCanonicalName()));
			handledDialogues.put("Larriar", (Class<Dialogue>) Class
					.forName(Larriar.class.getCanonicalName()));
			handledDialogues.put("SurgeonGeneralTafani",
					(Class<Dialogue>) Class.forName(SurgeonGeneralTafani.class
							.getCanonicalName()));
			handledDialogues.put("CapnIzzyNoBeard", (Class<Dialogue>) Class
					.forName(CapnIzzyNoBeard.class.getCanonicalName()));
			handledDialogues.put("Kaqemeex", (Class<Dialogue>) Class
					.forName(Kaqemeex.class.getCanonicalName()));
			handledDialogues.put("MartinThwait", (Class<Dialogue>) Class
					.forName(MartinThwait.class.getCanonicalName()));
			handledDialogues.put("MasterCrafter", (Class<Dialogue>) Class
					.forName(MasterCrafter.class.getCanonicalName()));
			handledDialogues.put("Hickton", (Class<Dialogue>) Class
					.forName(Hickton.class.getCanonicalName()));
			handledDialogues.put("HuntingExpert", (Class<Dialogue>) Class
					.forName(HuntingExpert.class.getCanonicalName()));
			handledDialogues.put("Dwarf", (Class<Dialogue>) Class
					.forName(Dwarf.class.getCanonicalName()));
			handledDialogues.put("Thurgo", (Class<Dialogue>) Class
					.forName(Thurgo.class.getCanonicalName()));
			handledDialogues.put("MasterFisher", (Class<Dialogue>) Class
					.forName(MasterFisher.class.getCanonicalName()));
			handledDialogues.put("HeadChef", (Class<Dialogue>) Class
					.forName(HeadChef.class.getCanonicalName()));
			handledDialogues.put("IgnatiusVulcan", (Class<Dialogue>) Class
					.forName(IgnatiusVulcan.class.getCanonicalName()));
			handledDialogues.put("Wilfred", (Class<Dialogue>) Class
					.forName(Wilfred.class.getCanonicalName()));
			handledDialogues.put("MartintheMasterGardener",
					(Class<Dialogue>) Class
							.forName(MartintheMasterGardener.class
									.getCanonicalName()));
			handledDialogues.put("Pikkupstix", (Class<Dialogue>) Class
					.forName(Pikkupstix.class.getCanonicalName()));
			handledDialogues.put("Thok", (Class<Dialogue>) Class
					.forName(Thok.class.getCanonicalName()));
			handledDialogues.put("NewPlayerTutorial", (Class<Dialogue>) Class
					.forName(NewPlayerTutorial.class.getCanonicalName()));
			handledDialogues.put("Max", (Class<Dialogue>) Class
					.forName(Max.class.getCanonicalName()));
			handledDialogues.put("MuseumGuard", (Class<Dialogue>) Class
					.forName(MuseumGuard.class.getCanonicalName()));
			handledDialogues.put("MuseumGuard2", (Class<Dialogue>) Class
					.forName(MuseumGuard2.class.getCanonicalName()));
			handledDialogues.put("PrayerD", (Class<Dialogue>) Class
					.forName(PrayerD.class.getCanonicalName()));
			handledDialogues.put("KaqemeexShop", (Class<Dialogue>) Class
					.forName(KaqemeexShop.class.getCanonicalName()));
			handledDialogues.put("PrestigeOne", (Class<Dialogue>) Class
					.forName(PrestigeOne.class.getCanonicalName()));
			handledDialogues.put("Xuan", (Class<Dialogue>) Class
					.forName(Xuans.class.getCanonicalName()));
			handledDialogues.put("Jatix", (Class<Dialogue>) Class
					.forName(Jatix.class.getCanonicalName()));
			handledDialogues.put("XPBook", (Class<Dialogue>) Class
					.forName(XPBook.class.getCanonicalName()));
			handledDialogues.put("BobBarterD", (Class<Dialogue>) Class
					.forName(BobBarterD.class.getCanonicalName()));
			handledDialogues.put("SandD", (Class<Dialogue>) Class
					.forName(SandD.class.getCanonicalName()));
			handledDialogues.put("BrokenTorvaHelm", (Class<Dialogue>) Class
					.forName(BrokenTorvaHelm.class.getCanonicalName()));
			handledDialogues.put("BrokenTorvaPlatebody",
					(Class<Dialogue>) Class.forName(BrokenTorvaPlatebody.class
							.getCanonicalName()));
			handledDialogues.put("BrokenTorvaPlatelegs",
					(Class<Dialogue>) Class.forName(BrokenTorvaPlatelegs.class
							.getCanonicalName()));
			handledDialogues.put("BrokenPernixBody", (Class<Dialogue>) Class
					.forName(BrokenPernixBody.class.getCanonicalName()));
			handledDialogues.put("BrokenPernixChaps", (Class<Dialogue>) Class
					.forName(BrokenPernixChaps.class.getCanonicalName()));
			handledDialogues.put("BrokenPernixCowl", (Class<Dialogue>) Class
					.forName(BrokenPernixCowl.class.getCanonicalName()));
			handledDialogues.put("BrokenVirtusMask", (Class<Dialogue>) Class
					.forName(BrokenVirtusMask.class.getCanonicalName()));
			handledDialogues.put("BrokenVirtusRobeLegs",
					(Class<Dialogue>) Class.forName(BrokenVirtusRobeLegs.class
							.getCanonicalName()));
			handledDialogues.put("BrokenVirtusRobeTop", (Class<Dialogue>) Class
					.forName(BrokenVirtusRobeTop.class.getCanonicalName()));
			handledDialogues.put("BobBarterD", (Class<Dialogue>) Class
					.forName(BobBarterD.class.getCanonicalName()));
			handledDialogues.put("DegMorriganCoif", (Class<Dialogue>) Class
					.forName(DegMorriganCoif.class.getCanonicalName()));
			handledDialogues.put("DegMorriganLeatherBody",
					(Class<Dialogue>) Class
							.forName(DegMorriganLeatherBody.class
									.getCanonicalName()));
			handledDialogues.put("DegMorriganLeatherChaps",
					(Class<Dialogue>) Class
							.forName(DegMorriganLeatherChaps.class
									.getCanonicalName()));
			handledDialogues.put("DegStatiusFullHelm", (Class<Dialogue>) Class
					.forName(DegStatiusFullHelm.class.getCanonicalName()));
			handledDialogues.put("DegStatiusPlatebody", (Class<Dialogue>) Class
					.forName(DegStatiusPlatebody.class.getCanonicalName()));
			handledDialogues.put("DegStatiusPlatelegs", (Class<Dialogue>) Class
					.forName(DegStatiusPlatelegs.class.getCanonicalName()));
			handledDialogues.put("DegStatiusWarHammer", (Class<Dialogue>) Class
					.forName(DegStatiusWarHammer.class.getCanonicalName()));
			handledDialogues.put("DegVestaChainbody", (Class<Dialogue>) Class
					.forName(DegVestaChainbody.class.getCanonicalName()));
			handledDialogues.put("DegVestaLongsword", (Class<Dialogue>) Class
					.forName(DegVestaLongsword.class.getCanonicalName()));
			handledDialogues.put("DegVestaPlateskirt", (Class<Dialogue>) Class
					.forName(DegVestaPlateskirt.class.getCanonicalName()));
			handledDialogues.put("DegVestaSpear", (Class<Dialogue>) Class
					.forName(DegVestaSpear.class.getCanonicalName()));
			handledDialogues.put("DegZurielHood", (Class<Dialogue>) Class
					.forName(DegZurielHood.class.getCanonicalName()));
			handledDialogues.put("DegZurielRobeBottom", (Class<Dialogue>) Class
					.forName(DegZurielRobeBottom.class.getCanonicalName()));
			handledDialogues.put("DegZurielRobeTop", (Class<Dialogue>) Class
					.forName(DegZurielRobeTop.class.getCanonicalName()));
			handledDialogues.put("DegZurielStaff", (Class<Dialogue>) Class
					.forName(DegZurielStaff.class.getCanonicalName()));
			handledDialogues.put("FlowerPickup", (Class<Dialogue>) Class
					.forName(FlowerPickup.class.getCanonicalName()));
			handledDialogues.put("Hans", (Class<Dialogue>) Class
					.forName(Hans.class.getCanonicalName()));
			handledDialogues.put("CaptainJute", (Class<Dialogue>) Class
					.forName(CaptainJute.class.getCanonicalName()));
			handledDialogues.put("DTRewards", (Class<Dialogue>) Class
					.forName(DTRewards.class.getCanonicalName()));
			handledDialogues.put("CooksAssistant", (Class<Dialogue>) Class
					.forName(CooksAssistant.class.getCanonicalName()));
			handledDialogues.put("Fred", (Class<Dialogue>) Class
					.forName(Fred.class.getCanonicalName()));
			handledDialogues.put("Groats", (Class<Dialogue>) Class
					.forName(Groats.class.getCanonicalName()));
			handledDialogues.put("SkillsInstructor", (Class<Dialogue>) Class
					.forName(SkillsInstructor.class.getCanonicalName()));
			handledDialogues.put("Nasaroth", (Class<Dialogue>) Class
					.forName(Nasaroth.class.getCanonicalName()));
			handledDialogues.put("PvMRewards", (Class<Dialogue>) Class
					.forName(PvMRewards.class.getCanonicalName()));
			handledDialogues.put("Page2PvM", (Class<Dialogue>) Class
					.forName(Page2PvM.class.getCanonicalName()));
			handledDialogues.put("Page3PvM", (Class<Dialogue>) Class
					.forName(Page3PvM.class.getCanonicalName()));
			handledDialogues.put("TaskSystem", (Class<Dialogue>) Class
					.forName(TaskSystem.class.getCanonicalName()));
			handledDialogues.put("Titles", (Class<Dialogue>) Class
					.forName(Titles.class.getCanonicalName()));
			handledDialogues.put("TrainingTeleports", (Class<Dialogue>) Class
					.forName(TrainingTeleports.class.getCanonicalName()));
			handledDialogues.put("RankShop", (Class<Dialogue>) Class
					.forName(RankShop.class.getCanonicalName()));
			handledDialogues.put("Enter", (Class<Dialogue>) Class
					.forName(Enter.class.getCanonicalName()));
			handledDialogues.put("GambleItemD", (Class<Dialogue>) Class
					.forName(GambleItemD.class.getCanonicalName()));
			handledDialogues.put("GambleConfirm", (Class<Dialogue>) Class
					.forName(GambleConfirm.class.getCanonicalName()));
			handledDialogues.put("LeavingCitadel", (Class<Dialogue>) Class
					.forName(LeavingCitadel.class.getCanonicalName()));
			for (File file : new File("bin/net/xiduth/game/player/dialogues/impl").listFiles()) {
				String name = file.getName();
				name = name.substring(0, name.length() - 6);
				Class<? extends Dialogue> clazz = Class.forName("net.xiduth.game.player.dialogues.impl." + name).asSubclass(Dialogue.class);
				if (!handledDialogues.containsKey(name)) {
					handledDialogues.put(name, (Class<Dialogue>) clazz);
				}
			/**
			 * 
			 * Dialogues in this folder will automatically be handled.
			 * 
			 */
			for (File file1 : new File("bin/net/xiduth/game/player/dialogues/auto").listFiles()) {
					String name1 = file1.getName();
					name1 = name1.substring(0, name1.length() - 6);
					Class<? extends Dialogue> clazz1 = Class.forName("net.xiduth.game.player.dialogues.auto." + name1).asSubclass(Dialogue.class);
					if (!handledDialogues.containsKey(name1)) {
						handledDialogues.put(name1, (Class<Dialogue>) clazz1);
					}
			}
			for (File file1 : new File("bin/net/xiduth/game/player/dialogues/construction").listFiles()) {
				String name1 = file1.getName();
				name1 = name1.substring(0, name1.length() - 6);
				Class<? extends Dialogue> clazz1 = Class.forName("net.xiduth.game.player.dialogues.construction." + name1).asSubclass(Dialogue.class);
				if (!handledDialogues.containsKey(name1)) {
					handledDialogues.put(name1, (Class<Dialogue>) clazz1);
				}
			}
			}
		} catch (Throwable e) {
			Logger.handle(e);
		}
	}

	public static final void reload() {
		handledDialogues.clear();
		init();
	}

	public static final Dialogue getDialogue(Object key) {
		if (key instanceof Dialogue)
			return (Dialogue) key;
		Class<Dialogue> classD = handledDialogues.get(key);
		if (classD == null)
			return null;
		try {
			return classD.newInstance();
		} catch (Throwable e) {
			Logger.handle(e);
		}
		return null;
	}

	private DialogueHandler() {

	}
}
